package com.i2863.watchdog.inspect;

import com.i2863.watchdog.util.ResponseInfo;

import java.util.List;

/**
 * @author xuweiwei
 * @date 2017/12/6
 */
public class HttpCodeInspector implements  Inspector {

    private List<Integer> successList;

    @Override
    public boolean pass(ResponseInfo responseInfo) {
        for(Integer code:successList){
            if(code.equals(responseInfo.getCode())){
                return true;
            }
        }
        return false;
    }

    public List<Integer> getSuccessList() {
        return successList;
    }

    public void setSuccessList(List<Integer> successList) {
        this.successList = successList;
    }
}
